import axios from 'axios'
import axiosConf from './axios.config'


// 配置，相当于实例化一个axios
const request = axios.create(axiosConf);
export default request
request.interceptors.response.use(function (res) {
  if (res.data.code === -10000){
    router.push('/auth/login')
  }else {
    return res;
  }
});
request.interceptors.request.use(function (req) {
  return req;
});
